﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using dbcontrol = BD2_5479_5513.DatabaseControl;
using memoria_partilhada = BD2_5479_5513.SharedMemory;

namespace BD2_5479_5513
{
    public partial class FormMarcarAvaliacao : Form
    {
        public FormMarcarAvaliacao()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            dbcontrol bd = new dbcontrol();
            memoria_partilhada mem = new memoria_partilhada();

            var cod_tipo_avaliacao = 1 + this.comboBox1.SelectedIndex;

            var id_disciplina = mem.id_disciplina;

            var cod_professor = mem.codUtilizador;

            var data = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");

            var sala = (this.textBox1.Text).Substring(0, 3);

            int hora = (int)this.numericUpDownhora.Value;

            int minutos = (int)this.numericUpDownmin.Value;

            int peso = (int)this.numericUpDownpercent.Value;

            var mensagem = bd.marcar_avaliacao(cod_tipo_avaliacao, id_disciplina, cod_professor, data, sala, hora, minutos, peso);

            System.Windows.Forms.MessageBox.Show(mensagem);
        }
    }
}
